/**
 * Created by abdulazizalonizi on 7/29/17.
 */
import java.util.Scanner  ;
public class Task2 {
    public static void main (String [] args)
    {

        Scanner kb = new Scanner (System.in);
        int [] arr1 = new int [10] ;
        System.out.println("enter 10 numbers");

        int countPos = 0;
        int countNeg = 0 ;


        for (int i = 0 ; i < arr1.length ; i++) {

            arr1[i] = kb.nextInt();
        }

        int max = arr1[0];
        int min = arr1[0];
        int indexMax = 0 ;
        int indexMin = 0 ;

        for (int i = 0 ; i < arr1.length ; i++)
        {
            if (arr1[i] >max)
            {
                max = arr1[i];
                indexMax = i ;

            }

            if (arr1[i] < min )
            {
                min = arr1[i];
                indexMin = i ;

            }
        }

        System.out.println("Max = " + max + " at index : " +indexMax +  "\n" + "Min = " + min + " at index :" + indexMin);






    }
}
